import datasets

if '__main__' == __name__:
    # path = "bleu"
    path = "/home/yunpeng/.cache/huggingface/modules/datasets_modules/metrics/bleu/961010342f0298f3e92cac3366046418f6eb9c89e6505f4803bbb2c73d3ae6a7/bleu.py"
    
    bleu = datasets.load_metric(path, trust_remote_code=True)
    print(bleu)

    predictions = [
        ["hello", "there", "general", "kenobi", "right", "now"],                             # tokenized prediction of the first sample
        ["foo", "bar", "foobar"]                                             # tokenized prediction of the second sample
    ]
    references = [
        [["hello", "there", "general", "kenobi"], ["hello", "there", "!"]],  # tokenized references for the first sample (2 references)
        [["foo", "bar", "foobar"]]                                           # tokenized references for the second sample (1 reference)
    ]
    results = bleu.compute(predictions=predictions, references=references)
    print(results)
